<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>字符串其它的方法</title>
    
</head>
<body>
    <script type="text/javascript">
        var str = 'hello world';
        console.log(str);

        console.log(str.indexOf('o'));
        console.log(str.indexOf('o',6));
        console.log(str.lastIndexOf('o'));
        console.log(str.lastIndexOf('o',6));

        var newStr = '    hello world    ';
        console.log(newStr);
        // 去除字符串前后空格
        console.log(str.trim());
        console.log(newStr);

        console.log(str.toLowerCase());
        console.log(str.toUpperCase());

    </script>
</body>
</html>